#include <boost/thread/thread.hpp>
#include <boost/thread/condition_variable.hpp>
#include <iostream>
#include <vector>

#include <stdio.h>


#include "integral.hpp"
#include "config.hpp"

using namespace std;


int main ( int argc, char *argv[] )
{
    int nThreads;

    if ( ( argc != 2 ) || ( sscanf ( argv[1],"%d",&nThreads ) != 1 ) || ( nThreads < 1 ) )
    {
        cout << "Wrong arguments. 2 threads will be used." << endl;
        nThreads = 2;
    }

    cout << "Integrate: " << _FUNC_STRING << " from: " << _A << " to: " << _B << " with precision: " << _PRECISION << endl;
////////////////

    RayTracer tracer( nThreads);

    tracer.SetScene();
    tracer.SetCamera();
    
    tracer.Init();

    tracer.Start();

    tracer.PrintResult();
    

    

    return 0;
}

